import time

from curl_cffi import requests


page = 1
total = 0

while True:
    time.sleep(1)
    url = f'https://mashangpa.com/api/problem-detail/3/data/?page={page}'

    headers = {
    'cookie':'sessionid=knisj2ex95xlec3gp1rwa8zg5sfpd0wk',
    'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36'
    }
    content = requests.get(url,headers=headers)

    print(content.json())

    items = content.json()['current_array']
    for e in items:
        print(e)
        total += e
    if content.json()['pagination']['has_next']:
        page += 1
    else:
        break

print(f'总数：{total}')










